package com.xyb.controller;

import com.xyb.entity.UserInfo;
import com.xyb.service.LoginService;
import com.xyb.vo.LoginVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("login")
public class LoginController {
    @Resource
    private LoginService loginService;

    @PostMapping("user")
    public UserInfo login(@RequestBody @Validated(LoginVo.IphoneNoLogin.class) LoginVo loginVo){
        UserInfo userInfo = loginService.selectUserInfoByIphoneNo(loginVo);
        return userInfo;
    }
}
